<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 100px;
            height: 100px;
            border: 1px solid #000;
            position: absolute;

        }
    </style>
</head>

<body>
    <div id="box"></div>
    <script>

        // 数据
        let obj = {
            x: 100,
            y: 100,
            bgcolor: 'black'
        }
        const box = document.getElementById('box')

        // bom
        const render = () => {
            box.style.left = obj.x
            console.log(box.style.x);



        }
        render()
    </script>
</body>

</html>